package o;

import android.net.Uri;
import android.text.TextUtils;
import com.huawei.hwid.core.constants.HwAccountConstants;
import java.net.URLDecoder;
import java.net.URLEncoder;

public abstract class dof {
    public static boolean ˋ(String str) {
        return str == null || str.trim().length() == 0;
    }

    public static boolean ॱ(String str) {
        return str == null || str.length() == 0;
    }

    public static String ˎ(String str) {
        if (!TextUtils.isEmpty(str)) {
            try {
                str = URLEncoder.encode(str, "UTF-8");
            } catch (Throwable e) {
                Logger.ˋ("StringUtils", "encodingURL error", e);
            }
        }
        return str;
    }

    public static String ˏ(String str) {
        if (str == null) {
            return null;
        }
        if ("****".equals(str) || "*".equals(str)) {
            return str;
        }
        try {
            return URLEncoder.encode(str, "UTF-8").replace("+", "%20").replace("*", "%2A").replace("~", "%7E");
        } catch (Throwable e) {
            Logger.ˋ("StringUtils", "encode2utf8 error", e);
            return null;
        } catch (Throwable e2) {
            Logger.ˋ("StringUtils", "encode2utf8 error", e2);
            return null;
        }
    }

    public static String ˊ(String str) {
        String str2 = null;
        if (str != null) {
            try {
                str2 = URLDecoder.decode(str, "UTF-8");
            } catch (Throwable e) {
                Logger.ˋ("StringUtils", "decode4utf8 error", e);
            } catch (Throwable e2) {
                Logger.ˋ("StringUtils", "decode4utf8 error", e2);
            }
        }
        return str2;
    }

    public static String ʻ(String str) {
        try {
            return new String(str.getBytes("UTF-8"), "UTF-8");
        } catch (Throwable e) {
            Logger.ˋ("StringUtils", "string2utf8 error", e);
            return null;
        }
    }

    public static boolean ᐝ(String str) {
        if (str != null && str.trim().startsWith("{") && str.trim().endsWith("}")) {
            return true;
        }
        return false;
    }

    public static String ʼ(String str) {
        if (str == null || str.length() == 0 || HwAccountConstants.NULL.equalsIgnoreCase(str)) {
            return "";
        }
        return str.trim();
    }

    public static boolean ʽ(String str) {
        if (str == null || str.trim().length() == 0) {
            return true;
        }
        return false;
    }

    public static String ॱॱ(String str) {
        char[] toCharArray = str.toCharArray();
        int i = 0;
        while (i < toCharArray.length) {
            if (toCharArray[i] == '　') {
                toCharArray[i] = ' ';
            } else if (toCharArray[i] > '＀' && toCharArray[i] < '｟') {
                toCharArray[i] = (char) (toCharArray[i] - 65248);
            }
            i++;
        }
        return toCharArray;
    }

    public static String ˏ(String str, String str2) {
        String str3 = null;
        if (!(TextUtils.isEmpty(str) || TextUtils.isEmpty(str2))) {
            try {
                str3 = Uri.parse(str).getQueryParameter(str2);
            } catch (Exception e) {
                Logger.e("StringUtils", "getValueOfUrl exception:" + e.getMessage());
            }
        }
        return str3;
    }

    public static boolean ˎ(String str, String str2) {
        if (str == null && str2 == null) {
            return true;
        }
        if (str != null && str.equals(str2)) {
            return true;
        }
        if (str2 == null || !str2.equals(str)) {
            return false;
        }
        return true;
    }
}
